<?php
//文章评论
namespace app\model;

use think\Model;

class Comment extends Model
{
    //自动更新时间戳字段
    protected $createTime = 'cd';
    // 关闭自动写入update_time字段
    protected $updateTime = false;

    /**
     * 存储留言
     * @param $name
     * @param $content
     * @param $aid
     * @param string $email
     * @param int $fid
     * @return bool
     */
    public function creatMes( $name, $content, $aid, $email = '', $fid = 0 )
    {

        if ( $name && $content ) {

            $insert = [ 'aid' => $aid, 'name' => $name, 'email' => $email, 'content' => $content, 'fid' => $fid, 'status' => 1 ];

            $re = $this->save( $insert );

            if ( $re ) {

                $return = true;

            } else {

                $return = false;

            }

        } else {

            $return = false;

        }

        return $return;

    }
}
